package com.changgou.service.goods.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.changgou.goods.pojo.Sku;
import com.changgou.service.goods.dao.SkuMapper;
import com.changgou.service.goods.service.SkuService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Package: com.changgou.service.goods.service.impl
 * ClassName: SkuServiceImpl
 * Description:
 *
 * @Author : 福森森
 * @Create : 2024/8/28 20:14
 */
@Service
public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuService {
    @Override
    public List<Sku> getListBySpuId(String id) {
        return this.lambdaQuery().eq(Sku::getSpuId, id).list();
    }

    @Override
    public void removeBySpuId(String id) {
        Sku sku = this.lambdaQuery().eq(Sku::getSpuId, id).one();
        this.removeById(sku);
    }
}
